home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / gofer221.zip / CH02 < prev    next >
Text File  |  1991-11-20  |  4KB  |  133 lines

  1.  
  2.  
  3. Introduction to Gofer         2. BACKGROUND AND ACKNOWLEDGEMENTS                
  4.  
  5.  
  6. 2. BACKGROUND AND ACKNOWLEDGEMENTS
  7.  
  8. The language supported by Gofer is both syntactically and  semantically
  9. similar to that of the functional programming language Haskell [5].  My
  10. principal task in the implementation of Gofer  has  therefore  been  to
  11. decide which  features  I  should  omit  and  then  to  implement  what
  12. remains.  Features common to both include:
  13.  
  14.   o  Non-strict semantics (lazy evaluation).
  15.   o  Higher-order functions.
  16.   o  Extended polymorphic type system  with  support  for  user-defined
  17.      overloading.
  18.   o  User-defined algebraic datatypes.
  19.   o  Pattern matching.
  20.   o  List comprehensions.
  21.   o  Facilities for  I/O,  whilst  retaining  referential  transparency
  22.      within a program.
  23.  
  24. For the  benefit  of  readers  familiar  with  Haskell,  the  following
  25. features of Haskell are not supported in the standard version of Gofer:
  26.  
  27.   o  Modules.
  28.   o  Arrays.
  29.   o  Defaults for unresolved overloading.
  30.   o  Derived instances of standard classes.
  31.   o  Contexts in datatype definitions.
  32.   o  Full range of numeric types and classes.
  33.  
  34. But Gofer is not just a partial  implementation  of  Haskell;  it  also
  35. includes a number of experimental features which extend the type system
  36. in several ways:
  37.  
  38.   o  An alternative approach to type classes which avoids the need  for
  39.      construction  of  dictionaries  during  the   evaluation   of   an
  40.      expression.
  41.   o  Type classes may take multiple parameters.
  42.   o  Instances  of  type  classes   may   be   defined   at   arbitrary
  43.      non-overlapping types.
  44.   o  Contexts may include arbitrary type expressions.
  45.  
  46. These extensions stem from my own research [8, 9, 10, 11, 12] and  were
  47. among the principal motivations for the  development  of  Gofer.   Full
  48. details of the differences between Gofer and Haskell 1.1 are  given  in
  49. appendix C.
  50.  
  51. Gofer would not have been implemented without my original  introduction
  52. to functional programming using  Orwell  [6],  and  I  am  particularly
  53. grateful to Quentin Miller for answering so many of my questions  about
  54. functional programming and about the Orwell system  in  particular.   I
  55. should also like to mention the influence of the  Haskell  B.  compiler
  56. from Lennart Augustsson and Thomas Johnsson and based on their  earlier
  57. LML compiler [7].
  58.  
  59. Right from the beginning, I wanted to be able to use Gofer on  a  range
  60. of machines - and in particular, on the humble PC that I use  at  home.
  61. With this in mind, Gofer was actually developed on that same  PC  using
  62.  
  63.  
  64.                                       2
  65.  
  66.  
  67.  
  68.  
  69. Introduction to Gofer         2. BACKGROUND AND ACKNOWLEDGEMENTS                
  70.  
  71.  
  72. Borland's Turbo C 1.5 and a public domain version of  the  yacc  parser
  73. generator that I picked up some time ago.  Gofer was also written  with
  74. some degree of portability in mind and has subsequently  been  compiled
  75. to run on Sun workstations.  I hope it will also be possible to port it
  76. to other platforms.  It is  my  intention  that  Gofer  be  distributed
  77. complete with source code and I hope that this will be of  interest  to
  78. some users.
  79.  
  80. Many of the ideas used in the back-end of the Gofer  system  (i.e.  the
  81. compiler and abstract machine) originate from  the  chapters  of  Simon
  82. Peyton Jones textbook [2]; I very much doubt whether Gofer  would  have
  83. been  completed  without  frequent  reference  to   that   book.    The
  84. lambda-lifter used in Gofer is based  on  Thomas  Johnsson's  algorithm
  85. described in [3].
  86.  
  87. On  the  theoretical  side,  I'm  grateful  to  Phil  Wadler  for   the
  88. encouragement that he has given me with my  work  on  qualified  types.
  89. Many of the basic ideas that I have used were inspired by his  original
  90. paper motivating the use of type classes [4].
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.                                       3
  131.  
  132.  
  133.